function [ flag, Support ] = somp_prepare( y,C,N,p )
%SOMP_PREPARE Summary of this function goes here
%   Detailed explanation goes here


        Q = y * y';

        %3: try to solve for U0
        % decompose Q to find frame V
        NumDomEigVals= FindNonZeroValues(eig(Q),5e-8);
        [V,d] = eig_r(Q,min(NumDomEigVals,2*N));
        v = V*diag(sqrt(d));
        [RecSupp] = SOMP(v, C,N);
        Support = sort(unique(RecSupp));

        flag = length(Support) <= p/2;

end

